package hn.sigit.dao.hnd.administrative;

import hn.sigit.model.hnd.administrative.HND_OperationPermit;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;

public class HND_OperationPermitDAO extends HND_PermitDAO {
	private static final long serialVersionUID = 1L;

	protected HND_OperationPermitDAO() {
	}
	
	public static HND_OperationPermit loadOperationPermitByID(long permitId) {
		return loadOperationPermitByID(getSession(), permitId);
	}

	public static HND_OperationPermit loadOperationPermitByID(Session session, long permitId) {
		Criteria criteria = session.createCriteria(HND_OperationPermit.class);
		criteria.add(Restrictions.eq("id", permitId));
		
		return (HND_OperationPermit) criteria.uniqueResult();
	}
}
